1
プロンプト機能の基本領域入門
AI010Lesson 2
00:00

プロンプティングの5つの柱

単純なチャットインターフェースを越えて、大規模言語モデル(LLMs)構造化データ処理の高度なエンジンとして機能します。本レッスンでは、開発者がAIをプロフェッショナルなワークフローに統合できる5つの機能的「プリミティブ」を紹介します。

機能的ロードマップ

  • 要約大量のテキスト(製品レビューなど)を要点情報を維持したまま簡潔な概要に圧縮すること。
  • 推論感情分析や感情の識別、ブランド名などの特定データポイントをJSON形式に抽出するなど、自動的な分析を行うこと。
  • 変換テキストを一種類から別の形式に変換すること——これは言語翻訳、トーン調整(例:フォーマル→カジュアル)、データ形式変換(例:JSONからHTML)を含む。
  • 拡張短い信号や箇条書きをもとに長文コンテンツを作成すること。たとえば、パーソナライズされたカスタマーサポートメールなど。
  • チャットボット会話履歴と定義された役割(システム、ユーザー、アシスタント)を利用して、対話的で文脈に応じたアシスタントを構築すること。
LLMの状態無し性について
重要な概念:人間とは異なり、LLMは「状態なし」です。各API呼び出しで会話履歴全体を手動で戻さない限り、以前のやり取りを記憶しません。この蓄積された履歴はコンテキストと呼ばれます。
main.py
TERMINALbash — 80x24
> Ready. Click "Run" to execute.
>
Question 1
A developer needs to extract the "Price" and "Discount Code" from 1,000 emails and save them to a database. Which approach and temperature setting are most appropriate?
A) Summarizing with Temperature = 0.7
B) Expanding with Temperature = 0
C) Inferring (Extracting) with Temperature = 0
D) Transforming with Temperature = 1.0
Challenge: Tone Transformer
Apply the Transforming and Chatbot role concepts.
You are building a "Tone Transformer" for a corporate helpdesk. You need to convert a frustrated user's slang-heavy complaint into a "Formal" and "Polite" summary for a manager.
Task
Specify the role of the "System" message to ensure the model acts appropriately, and write the "User" prompt to translate: 'The app is buggy as heck and I want my money back ASAP!'
System Message:
"You are a professional executive assistant. Your task is to rephrase communication into a formal, corporate-appropriate tone."

User Prompt:
"Translate the following text into a formal summary: 'The app is buggy as heck and I want my money back ASAP!'"

Expected Result:
"The customer is reporting technical instability within the application and is requesting an immediate refund."